import React from 'react';

//属性代理的高阶组件
export default function formWrapper(Comp) {
	return class WrapperComp extends React.Component{
		constructor(props) {
			super(props);
			this.state = {
				type: 'boss',
			};
		}
		handleChange = (key, v) => {			
			this.setState({
				[key]: v
			})
		}
		render() {
			return(
				<Comp
					handleChange={this.handleChange}
					state={this.state}
					{...this.props}
				></Comp>
			);
		}
	}
}